<template>
  <div>
    <keep-alive>
      <component
        :is="cName"
        @change="changeFn"
        @set="setFn"
        :obj="data"
        @answer="answerFn"
        :answer="answer"
      ></component>
    </keep-alive>
  </div>
</template>

<script>
import axios from "axios";
axios.defaults.baseURL = "http://124.223.14.236:3001/api";
import step1 from "./step1.vue";
import step2 from "./step2.vue";
import step3 from "./step3.vue";
export default {
  components: {
    step1,
    step2,
    step3,
  },
  data() {
    return {
      cName: "step1",
      data: {},
      answer: "",
    };
  },
  methods: {
    changeFn(type) {
      this.cName = type;
    },
    setFn(data) {
      this.data = data;
    },
    answerFn(answer) {
      this.answer = answer;
    },
  },
};
</script>

<style>
</style>